<template>
  <el-date-picker v-model="componentProps.modelValue" v-bind="$attrs" />
</template>

<script setup lang="ts">
import { computed, PropType } from "vue";
import { DraggableTreeNode, FormDataType, IDMapType } from "../../../type";
import { DateComponentData, DateComponentProps } from "./display-date";
const componentProps = computed({
  get() {
    return props.schema?.component?.componentProps || {};
  },
  set(val) {
    if (props.schema?.component?.componentProps) {
      props.schema.component.componentProps = val;
    }
  },
});
const props = defineProps({
  formData: {
    type: Object as PropType<FormDataType>,
    default: () => {
      return {};
    },
  },
  IDMap: {
    type: Object as PropType<IDMapType>,
    default: () => {
      return {};
    },
  },
  schema: {
    type: Object as PropType<DraggableTreeNode<
      DateComponentProps,
      DateComponentData
    > | null>,
    default: () => {
      return {};
    },
  },
});
</script>

<style lang="scss" scoped></style>
